from OSM_Map.OSM_Configuration_Menu import Configuration_Panel,MouseDownEvent_For_ConfigurePanel,ResetEvent_For_ConfigurationPanel
from OSM_Map.OSM_Event_Handler import OSM_Event_Handler,OSM_Anonymous_Event_Handler
from OSM_Map.OSM_HTML_BaseElement import Input_For_Form,Button_For_Form,Tabs,Select,Select_For_Form,LayuiStaticTable
from branca.element import (Element, Figure, JavascriptLink, MacroElement)
from jinja2 import Template

class Global_Network_Configuration_Panel(Configuration_Panel):

    def build(self,entity):

        mp= entity.get('Moving_Point') if entity.get('Moving_Point', None) else ""
        ec = entity.get('Edge_Cloud') if entity.get('Edge_Cloud', None) else ""
        ap = entity.get('Wireless_Access_Point') if entity.get('Wireless_Access_Point', None) else ""
        bc = entity.get('Base_Station') if entity.get('Base_Station', None) else ""
        nl = entity.get('NetWorkLink') if entity.get('NetWorkLink', None) else ""

        tab=Tabs(tabs_items=['网络全局设置', '移动点默认设置','wifi点默认设置','基站默认设置','边缘云默认设置','网络链接默认设置'])

        tab.add_child(Input_For_Form(labelName='IPV4基地址：', name='ipBase'),tab_num=1)
        tab.add_child(Input_For_Form(labelName='IPV6基地址：', name='ip6Base'),tab_num=1)
        tab.add_child(Input_For_Form(labelName='MAC基地址：', name='macColonHex'),tab_num=1)

        tab_mv=Tabs(tabs_items=['网络基础设置', 'CPU资源设置', '系统设置'])
        tab.add_child(tab_mv,tab_num=2)
        tab_mv.add_child(Input_For_Form(labelName='信号接收范围(m)：', name=mp.type+'_range'), tab_num=1)
        tab_mv.add_child(Input_For_Form(labelName='cpu带宽(us)：', name=mp.type+'_cpu_period',required=False), tab_num=2)
        tab_mv.add_child(Input_For_Form(labelName='cpu配额(us)：', name=mp.type+'_cpu_quota',required=False), tab_num=2)
        tab_mv.add_child(Input_For_Form(labelName='cpu份额相对值：', name=mp.type+'_cpu_shares',required=False), tab_num=2)
        tab_mv.add_child(Input_For_Form(labelName='物理内存：', name=mp.type+'_mem_limit',required=False), tab_num=2)
        tab_mv.add_child(Input_For_Form(labelName='虚拟内存：', name=mp.type+'_memswap_limit',required=False), tab_num=2)
        tab_mv.add_child(Input_For_Form(labelName='操作系统镜像：', name=mp.type+'_dimage'), tab_num=3)
        tab_mv.add_child(Input_For_Form(labelName='系统内核参数：', name=mp.type+'_sysctls'), tab_num=3)

        tab.add_child(Input_For_Form(labelName='信号接收范围(m)：', name=ap.type+'_range'), tab_num=3)
        tab.add_child(Select_For_Form(labelName="故障模式:", name=ap.type+'_failMode',options=[{"standalone": 'standalone', 'secure': 'secure'}], width="50%",margin='0px 0px 0px 40px'), tab_num=3)

        tab.add_child(Input_For_Form(labelName='信号接收范围(m)：', name=bc.type + '_range'), tab_num=4)
        tab.add_child(Select_For_Form(labelName="故障模式:", name=bc.type + '_failMode',options=[{"standalone": 'standalone', 'secure': 'secure'}], width="50%",margin='0px 0px 0px 40px'), tab_num=4)

        tab_ec = Tabs(tabs_items=['网络基础设置', 'CPU资源设置', '系统设置'])
        tab.add_child(tab_ec, tab_num=5)
        tab_ec.add_child(Input_For_Form(labelName='信号接收范围(m)：', name=ec.type+'_range'), tab_num=1)
        tab_ec.add_child(Input_For_Form(labelName='cpu带宽(us)：', name=ec.type+'_cpu_period',required=False), tab_num=2)
        tab_ec.add_child(Input_For_Form(labelName='cpu配额(us)：', name=ec.type+'_cpu_quota',required=False), tab_num=2)
        tab_ec.add_child(Input_For_Form(labelName='cpu份额相对值：', name=ec.type+'_cpu_shares',required=False), tab_num=2)
        tab_ec.add_child(Input_For_Form(labelName='物理内存：', name=ec.type+'_mem_limit',required=False), tab_num=2)
        tab_ec.add_child(Input_For_Form(labelName='虚拟内存：', name=ec.type+'_memswap_limit',required=False), tab_num=2)
        tab_ec.add_child(Input_For_Form(labelName='操作系统镜像：', name=ec.type+'_dimage'), tab_num=3)
        tab_ec.add_child(Input_For_Form(labelName='系统内核参数：', name=ec.type+'_sysctls'), tab_num=3)

        tab.add_child(Input_For_Form(labelName='带宽(Mbps)：', name='bw'), tab_num=6)
        tab.add_child(Input_For_Form(labelName='延迟：', name='delay'), tab_num=6)
        tab.add_child(Input_For_Form(labelName='延迟抖动：', name='jitter'), tab_num=6)
        tab.add_child(Input_For_Form(labelName='丢包率(%)：', name='loss'), tab_num=6)


        self.add_content(tab)

        self.add_content(Button_For_Form(buttonName="保存"))
        self.add_content(ResetEvent_For_ConfigurationPanel())
        self.add_content(SubmitEvent_For_Global_Network_Configuration_Panel())

        MouseDownEvent_For_ConfigurePanel().add_to(self)

class SubmitEvent_For_Global_Network_Configuration_Panel(OSM_Anonymous_Event_Handler):
    _template = Template(u"""
                    function(e){
                    e.preventDefault();
                    let Global_Network_Configuration_Layer=$(this).parent().slice(-1)[0]['belong'];
                    let items = $(this).find('input,select');
                    var judge=layer.confirm('IS Save？',{icon:7,title:'tips'},function()
                    {
                    $.each(items, function(){
                         if(this.name)
                         {
                            let v=this.value;
                            if(this.type=='checkbox')
                            {
                            v=$(this).prop("checked");
                            }
                           if(Global_Network_Configuration_Layer[this.name])
                           {
                           Global_Network_Configuration_Layer[this.name]=v;
                           }
                           else
                           {
                           Global_Network_Configuration_Layer['configuration'][this.name]=v;
                            // alert(this.name);
                           // alert(v);
                           }
                          }
                            });
                 /*   $.each(items, function(){
                            if(this.value)
                            {
                           Global_Network_Configuration_Layer['configuration'][this.name]=this.value;
                           }
                            });*/
                    Global_Network_Configuration_Layer['ipv4']=Global_Network_Configuration_Layer['netParse'](Global_Network_Configuration_Layer['configuration']['ipBase']);
                    Global_Network_Configuration_Layer['ipv6']=Global_Network_Configuration_Layer['netParse6'](Global_Network_Configuration_Layer['configuration']['ip6Base']);
                    Global_Network_Configuration_Layer['mac']=Global_Network_Configuration_Layer['macParse'](Global_Network_Configuration_Layer['configuration']['macColonHex']);
                    layer.close(layer.index);
                    }
                    );
                                }
                """)

    def __init__(self):
        super(SubmitEvent_For_Global_Network_Configuration_Panel, self).__init__()
        self._name = 'SubmitEvent_For_Global_Network_Configuration_Panel'
        self.event_type = 'submit'

class EmulationTest_Configuration_Panel(Configuration_Panel):

    def build(self,layer):
        table=LayuiStaticTable(thead={'filename':{'field':'filename','width':400},'date':{'field':'date','width':300,'sort':'true'},'choose':{'field':'choose','type':'radio','width':100}},limit=5)
        self.table=table
        self.add_content(table)
        self.add_content(Button_For_Form(buttonName="仿真",includeReset=False))
        self.add_content(SubmitEvent_For_EmulationTest_Configuration_Panel(layer,self.table,url='/emulation/',property=['filename']))

        MouseDownEvent_For_ConfigurePanel().add_to(self)


class SubmitEvent_For_EmulationTest_Configuration_Panel(OSM_Anonymous_Event_Handler):
    _template = Template(u"""
                    function(e){
                    e.preventDefault();
                    let property = {{ this.property|tojson|safe }};
                    let table = layui.table;
                    let file = table.checkStatus('{{this.table.get_name()}}');
                    let data=[];
                    if(file.data.length<1)
                    {
                    alert('Please select at least one item');
                    }
                    else
                    {
                    file.data.forEach(function(value)
                    {
                    let item={};
                    property.forEach(function(value1)
                    {
                    if(value[value1])
                    {
                    item[value1]=value[value1];
                    }
                    });
                    data.push(item);
                    });
                    var judge=layer.confirm('Are You Sure？',{icon:7,title:'tips'},function()
                    {
                    $.ajax({
                    type: 'POST',
                    url:  {{this.url}},
                    data: JSON.stringify(data),
                    contentType: 'application/json',
                    dataType: "json",
                    encode: true,
                    success: function (data) {
                    if(data["state"]=='success')
                    {
                    alert("上传成功，仿真正在运行");
                    if(data["situations"])
                    {
                    {{this.layer.get_name()}}.eachLayer(function(layer){
                    if(layer['configuration'])
                    {   
                        layer['configuration']['QoS_Sources']=data["situations"];
                        
                        if(layer['configuration']['QoS'])
                        {
                        layer['configuration']['QoS']['status']=false;
                        }
                        
                        /* let name = layer['configuration']['name'];
                        if(data["statistics"][name])
                        {
                        for(index in data["statistics"][name])
                        {
                        alert(index);
                        if(layer['configuration']['QoS'][index])
                        {
                        layer['configuration']['QoS'][index]['data']=data["statistics"][name][index]
                        }
                        }
                        // vega_parse(JSON.stringify(data["outcome"]),layer['configuration']['QoS']['delay']);
                         //layer['configuration']['QoS']['delay']['data']=data["outcome"];
                         // osm_vega_parse({"axes": [{"scale": "x", "title": "Time", "type": "x"}, {"scale": "y", "title": "Dominant Wave Period (s)", "type": "y"}], "data": [{"name": "table", "values": [{"col": "dominant_wave_period (s)", "idx": 1366257000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366260600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366264200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366267800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366271400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366275000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366278600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366282200000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366285800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366289400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366293000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366300200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366303800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366307400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366311000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366314600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366318200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366321800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366325400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366329000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366332600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366336200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366339800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366343400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366347000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366350600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366354200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366357800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366361400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366365000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366368600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366372200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366375800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366379400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366383000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366386600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366390200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366393800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366397400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366401000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366404600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366408200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366411800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366415400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366419000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366422600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366426200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366429800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366433400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366437000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366440600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366444200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366447800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366451400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366455000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366458600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366462200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366465800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366469400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366473000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366476600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366480200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366483800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366487400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366491000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366494600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366498200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366501800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366505400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366509000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366512600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366516200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366519800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366523400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366527000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366530600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366534200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366537800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366541400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366545000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366548600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366552200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366559400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366563000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366566600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366570200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366573800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366577400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366581000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366584600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366588200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366591800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366595400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366599000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366602600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366606200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366609800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366613400000, "val": 5.0}, {"col": "dominant_wave_period (s)", "idx": 1366617000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366620600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366624200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366627800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366631400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366635000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366638600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366642200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366645800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366649400000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366653000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366656600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366660200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366663800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366667400000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366671000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366674600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366678200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366681800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366685400000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366689000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366692600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366696200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366699800000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1366703400000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1366707000000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1366710600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366714200000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1366717800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366721400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366725000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366728600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366732200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366735800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366739400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366743000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1366746600000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1366750200000, "val": 12.0}, {"col": "dominant_wave_period (s)", "idx": 1366753800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366757400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366761000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366764600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366768200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366771800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366775400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366779000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366782600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366786200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366789800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366793400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366797000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366800600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366804200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366807800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366811400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366818600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366822200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366829400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366833000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366836600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366840200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366843800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366847400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366851000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366854600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366858200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366861800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366865400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366869000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366872600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366876200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1366879800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366883400000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366887000000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1366890600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1366894200000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366897800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366901400000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366905000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366908600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366912200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366915800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366919400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366923000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366926600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366930200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366933800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1366937400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366941000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366944600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366948200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366951800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366955400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366959000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366962600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366966200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366969800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366973400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366977000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1366980600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366984200000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366987800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366991400000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1366995000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1366998600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367002200000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367005800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367009400000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367013000000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367016600000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1367020200000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367023800000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367027400000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1367031000000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367034600000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367038200000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1367041800000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367045400000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367049000000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1367052600000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367056200000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367059800000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367063400000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367067000000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1367070600000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367077800000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367081400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367085000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367088600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367092200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367095800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367099400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367103000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367106600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367110200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367113800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367117400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367121000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367124600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367128200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367131800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367135400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367139000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367142600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367146200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367149800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367153400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367157000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367160600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367164200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367167800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367171400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367175000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367178600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367182200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367185800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367189400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367193000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367196600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367200200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367203800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367207400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367211000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367214600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367218200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367221800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367225400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367229000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367232600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367236200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367239800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367243400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367247000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367250600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367254200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367257800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367261400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367265000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367268600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367272200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367275800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367279400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367283000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367286600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367290200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367293800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367297400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367301000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367304600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367308200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367311800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367315400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367319000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367322600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367326200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367329800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367337000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367340600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367344200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367347800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367351400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367355000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367358600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367362200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367365800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367369400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367373000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367376600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367380200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367383800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367387400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367391000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367394600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367398200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367401800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367405400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367409000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367412600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367416200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367419800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367423400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367427000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367430600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367434200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367437800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367441400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367445000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367448600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367452200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367455800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367459400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367463000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367466600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367470200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367473800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367477400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367481000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367484600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367488200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367491800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367495400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367499000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367502600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367506200000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1367509800000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1367513400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367517000000, "val": 17.0}, {"col": "dominant_wave_period (s)", "idx": 1367520600000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1367524200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367527800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367531400000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367535000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367538600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367542200000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367545800000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1367549400000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1367553000000, "val": 5.0}, {"col": "dominant_wave_period (s)", "idx": 1367556600000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1367560200000, "val": 5.0}, {"col": "dominant_wave_period (s)", "idx": 1367563800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367571000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367574600000, "val": 5.0}, {"col": "dominant_wave_period (s)", "idx": 1367578200000, "val": 5.0}, {"col": "dominant_wave_period (s)", "idx": 1367581800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367585400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367589000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367592600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367596200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367599800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367603400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367607000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367610600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367614200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367617800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367621400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367625000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367628600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367632200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367635800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367639400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367643000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367646600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367650200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367653800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367657400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367661000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367664600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367668200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367671800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367675400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367679000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367682600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367686200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367689800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367693400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367697000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367700600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367704200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367707800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367711400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367715000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367718600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367722200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367725800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367729400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367733000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367736600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367740200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367743800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367747400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367751000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367754600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367758200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367761800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367765400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367769000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367772600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367776200000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367779800000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367783400000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367787000000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367790600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367794200000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1367797800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367801400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367805000000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367808600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367812200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367815800000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367819400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367823000000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367826600000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1367830200000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367833800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367837400000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367841000000, "val": 12.0}, {"col": "dominant_wave_period (s)", "idx": 1367844600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367848200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367851800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367855400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367859000000, "val": 12.0}, {"col": "dominant_wave_period (s)", "idx": 1367862600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367866200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1367869800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367873400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367877000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367880600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367884200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367887800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367891400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367895000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367898600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367902200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367905800000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367909400000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367913000000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367916600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1367920200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367923800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367927400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1367931000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1367934600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367938200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367941800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367945400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367949000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367952600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367956200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367959800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367963400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367967000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367970600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367974200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367977800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367981400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367985000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367988600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367992200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1367995800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1367999400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368003000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368006600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368010200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368013800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368017400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368021000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368024600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368028200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368031800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368035400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368039000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368042600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368046200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368049800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368053400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368057000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368060600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368064200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368067800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368071400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368075000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368078600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368082200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368085800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368089400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368093000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368096600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368100200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368103800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368107400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368111000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368114600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368118200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368121800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368125400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368129000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368132600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368136200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368139800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368143400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368147000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368150600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368154200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368157800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368161400000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368165000000, "val": 3.0}, {"col": "dominant_wave_period (s)", "idx": 1368168600000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1368172200000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1368175800000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1368179400000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1368183000000, "val": 3.0}, {"col": "dominant_wave_period (s)", "idx": 1368186600000, "val": 3.0}, {"col": "dominant_wave_period (s)", "idx": 1368190200000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368193800000, "val": 4.0}, {"col": "dominant_wave_period (s)", "idx": 1368197400000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1368201000000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368204600000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368208200000, "val": 5.0}, {"col": "dominant_wave_period (s)", "idx": 1368211800000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368215400000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368219000000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368222600000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368226200000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368229800000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1368233400000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368237000000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368240600000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368244200000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1368247800000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1368251400000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368255000000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368258600000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1368262200000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368265800000, "val": 14.0}, {"col": "dominant_wave_period (s)", "idx": 1368269400000, "val": 13.0}, {"col": "dominant_wave_period (s)", "idx": 1368273000000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1368276600000, "val": 16.0}, {"col": "dominant_wave_period (s)", "idx": 1368280200000, "val": 12.0}, {"col": "dominant_wave_period (s)", "idx": 1368283800000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1368287400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368291000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368294600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368298200000, "val": 15.0}, {"col": "dominant_wave_period (s)", "idx": 1368301800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368305400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368309000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368312600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368316200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368319800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368323400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368327000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368330600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368334200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368337800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368341400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368345000000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368348600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368352200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368355800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368359400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368363000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368366600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368370200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368373800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368377400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368381000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368384600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368388200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368391800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368395400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368399000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368402600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368406200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368409800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368413400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368417000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368420600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368424200000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368427800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368431400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368435000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368438600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368442200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368445800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368449400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368453000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368456600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368460200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368463800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368467400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368471000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368474600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368478200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368481800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368485400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368489000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368492600000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1368496200000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1368499800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368503400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368507000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368510600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368514200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368517800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368521400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368525000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368528600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368532200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368535800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368539400000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368543000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368546600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368550200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368553800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368557400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368561000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368564600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368568200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368571800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368575400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368579000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368582600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368586200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368589800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368593400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368597000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368600600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368604200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368607800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368611400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368615000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368618600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368622200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368625800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368629400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368633000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368636600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368640200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368643800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368647400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368651000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368654600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368658200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368665400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368669000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368672600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368676200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368679800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368683400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368687000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368690600000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368694200000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1368697800000, "val": 7.0}, {"col": "dominant_wave_period (s)", "idx": 1368701400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368705000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368708600000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368712200000, "val": 6.0}, {"col": "dominant_wave_period (s)", "idx": 1368715800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368719400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368723000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368726600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368730200000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368733800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368737400000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368741000000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368744600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368748200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368751800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368755400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368759000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368762600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368766200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368769800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368773400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368777000000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368780600000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368784200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368787800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368791400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368795000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368798600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368802200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368805800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368809400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368813000000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368816600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368820200000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368823800000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368827400000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368831000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368834600000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368838200000, "val": 11.0}, {"col": "dominant_wave_period (s)", "idx": 1368841800000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368845400000, "val": 10.0}, {"col": "dominant_wave_period (s)", "idx": 1368849000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368852600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368856200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368859800000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368863400000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368867000000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368870600000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368874200000, "val": 9.0}, {"col": "dominant_wave_period (s)", "idx": 1368877800000, "val": 8.0}, {"col": "dominant_wave_period (s)", "idx": 1368881400000, "val": 9.0}]}], "height": 200, "legends": [], "marks": [{"from": {"data": "table", "transform": [{"keys": ["data.col"], "type": "facet"}]}, "marks": [{"properties": {"enter": {"stroke": {"field": "data.col", "scale": "color"}, "strokeWidth": {"value": 2}, "x": {"field": "data.idx", "scale": "x"}, "y": {"field": "data.val", "scale": "y"}}}, "type": "line"}], "type": "group"}], "padding": "auto", "scales": [{"domain": {"data": "table", "field": "data.idx"}, "name": "x", "range": "width", "type": "time"}, {"domain": {"data": "table", "field": "data.val"}, "name": "y", "nice": true, "range": "height"}, {"domain": {"data": "table", "field": "data.col"}, "name": "color", "range": "category20", "type": "ordinal"}], "width": 800},layer['configuration']['QoS']['delay']['div']);
                         // alert("test");
                        }
                        */
                    }
                    });
                    }
                    }
                    else
                    {
                    alert("上传失败，仿真无法运行");
                    }
                    }
                    });
                    layer.close(layer.index);
                    });
                    }
                    }
                """)

    def __init__(self,layer,table,url,property=[]):
        super(SubmitEvent_For_EmulationTest_Configuration_Panel, self).__init__()
        self._name = 'SubmitEvent_For_EmulationTest_Configuration_Panel'
        self.event_type = 'submit'
        self.table=table
        self.layer=layer
        self.property=property
        self.url=url


class Emulation_Configuration_Panel(Configuration_Panel):

    def build(self, layer):
        tab = Tabs(tabs_items=['移动性模型配置','SDN控制器配置'])

        tab.add_child(Input_For_Form(labelName='移动开始时间(s)：', name='mobility_start_time', required=False, width='40%',margin='0px 0px 0px 50px'),tab_num=1)
        tab.add_child(Input_For_Form(labelName='移动结束时间(s)：', name='mobility_stop_time',placeholder='自动计算移动结束时间',auto_configuration='EmulationConfiguration',belong=layer,readonly=True, required=False,auto_option=True, width='40%',margin='0px 0px 0px 50px'), tab_num=1)
        tab.add_child(Select_For_Form(labelName="移动重复次数:", name='mob_rep',options=[{'1': '1'}, {'2': '2'}, {'3': '3'}, {'4': '4'},{'5': '5'}], width="30%",margin='0px 0px 0px 100px'), tab_num=1)
        tab.add_child(Input_For_Form(labelName='重复时是否反转:', name='reverse',type='checkbox',title='reverse',checked=False,margin='0px 0px 0px 60px'), tab_num=1)
        tab.add_child(Select_For_Form(labelName="移动性仿真实验模式:", name='mobility_mode', options=[{"quickly": '快速模式', 'completely': '完整模式'}], width="50%",margin='0px 0px 0px 100px'), tab_num=1)
        tab.add_child(Select_For_Form(labelName="无线关联机制:", name='ac_method',options=[{"ssf":'Strongest Signal First (SSF)','llf':'Least Loaded First (LLF)'}], width="50%",margin='0px 0px 0px 100px'), tab_num=1)
        # input=Input_For_Form(labelName='仿真实验方式：', name='emulation', required=False, width='40%',placeholder='请输入数值，不设置默认为10')
        # Select(name='emulationWays', required=False,options=[{'period':'s'},{'times':'times'}],width='10%').add_to(input)
        # tab.add_child(input,tab_num=2)
        # tab.add_child(Select_For_Form(labelName="仿真结果数据聚集程度:",name='aggregation',options=[{'1':'1'},{'5':'5'},{'10':'10'},{'20':'20'}],width="30%",margin='0px 0px 0px 100px'),tab_num=2)
        tab.add_child(Select_For_Form(labelName="SDN控制器类型：", name='SDN_Controller',options=[{"Controller": 'ovs-testcontroller', 'Ryu': 'Ryu','None': 'Disable Controller'}], width="50%",margin='0px 0px 0px 60px'), tab_num=2)
        tab.add_child(Input_For_Form(labelName='SDN控制器的名称：', name='Controller_Name', required=False, width='40%',margin='0px 0px 0px 60px'), tab_num=2)
        tab.add_child(Input_For_Form(labelName='SDN控制器数量：', name='Controller_Number', required=False, width='40%',margin='0px 0px 0px 60px'), tab_num=2)
        tab.add_child(Input_For_Form(labelName='SDN控制器所在IP地址：', name='Controller_IP', required=False, width='40%',margin='0px 0px 0px 90px'), tab_num=2)
        tab.add_child(Input_For_Form(labelName='SDN控制器监听端口(5000 < port < 10000)：', name='Controller_Port', required=False, width='10%',margin='0px 0px 0px 210px'), tab_num=2)
        tab.add_child(Select_For_Form(labelName="通信协议：", name='Controller_Protocol', options=[{"tcp": 'tcp', 'tls': 'tls'}], width="50%"), tab_num=2)
        tab.add_child(Input_For_Form(labelName='SDN控制器运行的应用名称：', name='Network_Application', required=False, width='40%',margin='0px 0px 0px 130px'), tab_num=2)

        self.add_content(tab)
        self.add_content(Button_For_Form(buttonName="配置"))
        self.add_content(SubmitEvent_For_Emulation_Configuration_Panel(layer))
        self.add_content(ResetEvent_For_Emulation_Configuration_Panel(layer))

        MouseDownEvent_For_ConfigurePanel().add_to(self)

class SubmitEvent_For_Emulation_Configuration_Panel(OSM_Anonymous_Event_Handler):
    _template = Template(u"""
                    function(e){
                    e.preventDefault();
                    let EmulationConfiguration= {{this.layer.get_name()}}['configuration']['EmulationConfiguration'];
                    let items = $(this).find('input,select');
                    var judge=layer.confirm('IS SAVE AND CONFIGURATION？',{icon:7,title:'tips'},function()
                    {
                    $.each(items, function(){
                         if(this.name)
                         {
                            EmulationConfiguration[this.name]=this.value;
                            if(this.type=='checkbox')
                            {
                            EmulationConfiguration[this.name]=$(this).prop("checked");
                            }
                          }
                            });
                    layer.close(layer.index);
                    });
                        }
                """)

    def __init__(self,layer):
        super(SubmitEvent_For_Emulation_Configuration_Panel, self).__init__()
        self._name = 'SubmitEvent_For_Emulation_Configuration_Panel'
        self.event_type = 'submit'
        self.layer=layer

class ResetEvent_For_Emulation_Configuration_Panel(OSM_Anonymous_Event_Handler):
    _template = Template(u"""
                    function(e){
                    e.preventDefault();
                    let EmulationConfiguration= {{this.layer.get_name()}}['configuration']['EmulationConfiguration'];
                    let items = $(this).find('input,select');
                    var judge=layer.confirm('IS SAVE AND CONFIGURATION？',{icon:7,title:'tips'},function()
                    {       
                            $.each(items, function() {
                             let value = EmulationConfiguration[this.name];
                             let autoflag = EmulationConfiguration['Auto_Configuration_'+this.name];
                             if(typeof(value)!='undefined')
                             {
                             if(this.type=='checkbox')
                             {
                             $(this).prop("checked", JSON.parse(value));
                             }
                             else
                             {
                             this.value = value;
                             
                             if(value&&autoflag)
                             {
                             this.setAttribute("readOnly", true);
                             }
                             
                             }
                             }
                             else
                             {
                                if(this.type=='checkbox')
                                {
                                    $(this).prop("checked", true);
                                }
                                else
                                {
                                    if(this.type=='text')
                                    {
                                        this.value='';
                                    }
                                    else if(this.tagName=='SELECT')
                                    {       
                                           $(this).find("option").eq(0).prop("selected",true);
                                    }
                                }
                             }
                             layui.form.render();
                                });
                            layer.close(layer.index);
                    }
                    );
                                }
                """)

    def __init__(self,layer):
        super(ResetEvent_For_Emulation_Configuration_Panel, self).__init__()
        self._name = 'ResetEvent_For_Emulation_Configuration_Panel'
        self.event_type = 'reset'
        self.layer=layer